package androidx.fragment.app;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.util.Log;
import androidx.annotation.NonNull;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import o.jy;
import o.kd;
import o.kp.c;

@SuppressLint({"BanParcelableUsage"})
public final class FragmentState implements Parcelable {
    public static final Creator<FragmentState> CREATOR = new Creator<FragmentState>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return ˏ(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return ˋ(i);
        }

        public FragmentState ˏ(Parcel parcel) {
            return new FragmentState(parcel);
        }

        public FragmentState[] ˋ(int i) {
            return new FragmentState[i];
        }
    };
    final boolean ʻ;
    final String ʼ;
    final Bundle ʽ;
    final int ˊ;
    public Fragment ˊॱ;
    final int ˋ;
    public Bundle ˋॱ;
    public final String ˎ;
    final String ˏ;
    final boolean ˏॱ;
    final int ͺ;
    final boolean ॱ;
    final boolean ॱॱ;
    final boolean ᐝ;

    public FragmentState(Fragment fragment) {
        this.ˏ = fragment.getClass().getName();
        this.ˎ = fragment.ˊॱ;
        this.ॱ = fragment.ʿ;
        this.ˋ = fragment.ˌ;
        this.ˊ = fragment.ˍ;
        this.ʼ = fragment.ˎˎ;
        this.ᐝ = fragment.ˑ;
        this.ʻ = fragment.ʼॱ;
        this.ॱॱ = fragment.ˋᐝ;
        this.ʽ = fragment.ॱˎ;
        this.ˏॱ = fragment.ˋˋ;
        this.ͺ = fragment.ꜞ.ordinal();
    }

    FragmentState(Parcel parcel) {
        boolean z;
        boolean z2 = true;
        this.ˏ = parcel.readString();
        this.ˎ = parcel.readString();
        this.ॱ = parcel.readInt() != 0;
        this.ˋ = parcel.readInt();
        this.ˊ = parcel.readInt();
        this.ʼ = parcel.readString();
        if (parcel.readInt() != 0) {
            z = true;
        } else {
            z = false;
        }
        this.ᐝ = z;
        if (parcel.readInt() != 0) {
            z = true;
        } else {
            z = false;
        }
        this.ʻ = z;
        if (parcel.readInt() != 0) {
            z = true;
        } else {
            z = false;
        }
        this.ॱॱ = z;
        this.ʽ = parcel.readBundle();
        if (parcel.readInt() == 0) {
            z2 = false;
        }
        this.ˏॱ = z2;
        this.ˋॱ = parcel.readBundle();
        this.ͺ = parcel.readInt();
    }

    public Fragment ˋ(@NonNull ClassLoader classLoader, @NonNull jy jyVar) {
        if (this.ˊॱ == null) {
            if (this.ʽ != null) {
                this.ʽ.setClassLoader(classLoader);
            }
            this.ˊॱ = jyVar.ॱ(classLoader, this.ˏ);
            this.ˊॱ.ʼ(this.ʽ);
            if (this.ˋॱ != null) {
                this.ˋॱ.setClassLoader(classLoader);
                this.ˊॱ.ॱˊ = this.ˋॱ;
            } else {
                this.ˊॱ.ॱˊ = new Bundle();
            }
            this.ˊॱ.ˊॱ = this.ˎ;
            this.ˊॱ.ʿ = this.ॱ;
            this.ˊॱ.ˈ = true;
            this.ˊॱ.ˌ = this.ˋ;
            this.ˊॱ.ˍ = this.ˊ;
            this.ˊॱ.ˎˎ = this.ʼ;
            this.ˊॱ.ˑ = this.ᐝ;
            this.ˊॱ.ʼॱ = this.ʻ;
            this.ˊॱ.ˋᐝ = this.ॱॱ;
            this.ˊॱ.ˋˋ = this.ˏॱ;
            this.ˊॱ.ꜞ = c.values()[this.ͺ];
            if (kd.ˎ) {
                Log.v("FragmentManager", "Instantiated fragment " + this.ˊॱ);
            }
        }
        return this.ˊॱ;
    }

    @NonNull
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder(DnsConfig.MAX_CACHE_ENTRIES);
        stringBuilder.append("FragmentState{");
        stringBuilder.append(this.ˏ);
        stringBuilder.append(" (");
        stringBuilder.append(this.ˎ);
        stringBuilder.append(")}:");
        if (this.ॱ) {
            stringBuilder.append(" fromLayout");
        }
        if (this.ˊ != 0) {
            stringBuilder.append(" id=0x");
            stringBuilder.append(Integer.toHexString(this.ˊ));
        }
        if (!(this.ʼ == null || this.ʼ.isEmpty())) {
            stringBuilder.append(" tag=");
            stringBuilder.append(this.ʼ);
        }
        if (this.ᐝ) {
            stringBuilder.append(" retainInstance");
        }
        if (this.ʻ) {
            stringBuilder.append(" removing");
        }
        if (this.ॱॱ) {
            stringBuilder.append(" detached");
        }
        if (this.ˏॱ) {
            stringBuilder.append(" hidden");
        }
        return stringBuilder.toString();
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        int i2;
        int i3 = 1;
        parcel.writeString(this.ˏ);
        parcel.writeString(this.ˎ);
        parcel.writeInt(this.ॱ ? 1 : 0);
        parcel.writeInt(this.ˋ);
        parcel.writeInt(this.ˊ);
        parcel.writeString(this.ʼ);
        if (this.ᐝ) {
            i2 = 1;
        } else {
            i2 = 0;
        }
        parcel.writeInt(i2);
        if (this.ʻ) {
            i2 = 1;
        } else {
            i2 = 0;
        }
        parcel.writeInt(i2);
        if (this.ॱॱ) {
            i2 = 1;
        } else {
            i2 = 0;
        }
        parcel.writeInt(i2);
        parcel.writeBundle(this.ʽ);
        if (!this.ˏॱ) {
            i3 = 0;
        }
        parcel.writeInt(i3);
        parcel.writeBundle(this.ˋॱ);
        parcel.writeInt(this.ͺ);
    }
}
